<!DOCTYPE html>
<html>
<head>
    <#assign secSelect = JspTaglibs["http://www.casic304.cn/secSelect"] />
    <#assign fillDept=JspTaglibs["http://www.casic304.cn/fillDept"] />
    <#assign dicSelect = JspTaglibs["http://www.casic304.cn/dicSelect"]/>
    <meta charset="utf-8">
    <title>筛选批次不合格</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/style/qbdms.css">
    <script type="text/javascript">
        var __ctx = "${ctx}";
    </script>
</head>
<body class="listBody">
<div class="qbdms-bodyDiv">
    <div class="layui-table-view-body qbdms-add-view-body">
        <form class="formPreview layui-form"  requrl="${ctx}/qbdms/wQbdComponentscreen/get"
              lay-filter="wQbdComponentscreenDataForm">
            <div class="qbdms-formTitle">筛选批次不合格 <i class="qbdms-returnOn closeWindow">返回</i></div>
            <div class="qbdms-formBody">
                <@fillDept.dept id="tbxx"/>
                <div class="layui-row">
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label" title="密级">密级<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <@secSelect.sec_select data_src=1 required=true name="secret"/>
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="元器件名称">元器件名称<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="componentName"  placeholder="请输入"
                                   autocomplete="off" class="layui-input  textInput" lay-verify="required" lay-reqtext="元器件名称是必填项"
                                   maxlength="50" fieldname="componentName">
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="元器件型号规格">元器件型号规格<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="componentSpec"  placeholder="请输入"
                                   autocomplete="off" class="layui-input  textInput" lay-verify="required" lay-reqtext="元器件型号规格是必填项"
                                   maxlength="50" fieldname="componentSpec">
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="质量等级">质量等级<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input" >
                            <@dicSelect.dic name="qualityLevel" nodeKey="zldj" verify="required" reqtext="质量等级是必填项"/>
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="元器件批次号">
                            元器件批次号<span style="color: red;">*</span>
                        </label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="componentBatchid"  placeholder="请输入"
                                   autocomplete="off" class="layui-input  textInput" lay-verify="required" lay-reqtext="元器件批次号是必填项"
                                   maxlength="50" fieldname="componentBatchid">
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="筛选数量">
                            筛选数量<span style="color: red;">*</span>
                        </label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="screenNumber"  placeholder="请输入"
                                   autocomplete="off" class="layui-input  textInput" lay-verify="required|num" lay-reqtext="筛选数量是必填项"
                                   maxlength="10" fieldname="screenNumber">
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="不合格数">
                            不合格数<span style="color: red;">*</span>
                        </label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="unqualifiedNumber"  placeholder="请输入"
                                   autocomplete="off" class="layui-input  textInput" lay-verify="required|num|bigger" lay-reqtext="不合格数是必填项"
                                   maxlength="10" fieldname="unqualifiedNumber">
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="合格判据">
                            合格判据<span style="color: red;">*</span>
                        </label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="qualifiedCriterion"  placeholder="请输入"
                                   autocomplete="off" class="layui-input  textInput" lay-verify="required" lay-reqtext="合格判据是必填项"
                                   maxlength="50" fieldname="qualifiedCriterion">
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="实测值">
                            实测值<span style="color: red;">*</span>
                        </label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="measuredValue"  placeholder="请输入"
                                   autocomplete="off" class="layui-input  textInput" lay-verify="required|num" lay-reqtext="实测值是必填项"
                                   maxlength="10" fieldname="measuredValue">
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="生产单位">
                            生产单位<span style="color: red;">*</span>
                        </label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="productionUnit"  placeholder="请输入"
                                   autocomplete="off" class="layui-input  textInput" lay-verify="required" lay-reqtext="生产单位是必填项"
                                   maxlength="50" fieldname="productionUnit">
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="工程型号">
                            工程型号<span style="color: red;">*</span>
                        </label>
                        <div class="layui-input-block qbdms-input" >
                            <@dicSelect.dic name="projectModel" nodeKey="gcxh" verify="required" reqtext="工程型号是必填项"/>
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="供应商">
                            供应商<span style="color: red;">*</span>
                        </label>
                        <div class="layui-input-block qbdms-input" >
                            <select name="supplier" lay-verify="required" lay-reqtext="供应商是必填项" maxlength="50"></select>
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="是否合格供方">
                            是否合格供方<span style="color: red;">*</span>
                        </label>
                        <div class="layui-input-block qbdms-input">
                            <select name="qualifiedSuppliers" lay-verify="required" lay-reqtext="是否合格供方是必填项"  maxlength="50">
                                <option></option>
                                <option value="是">是</option>
                                <option value="否">否</option>
                            </select>
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="是否选用目录">
                            是否选用目录<span style="color: red;">*</span>
                        </label>
                        <div class="layui-input-block qbdms-input">
                            <select name="catalogSelection" lay-verify="required" lay-reqtext="是否选用目录是必填项"  maxlength="50">
                                <option></option>
                                <option value="是">是</option>
                                <option value="否">否</option>
                            </select>
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="筛选报告编号">
                            筛选报告编号<span style="color: red;">*</span>
                        </label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="screenReportid"  placeholder="请输入"
                                   autocomplete="off" class="layui-input  textInput" lay-verify="required" lay-reqtext="筛选报告编号是必填项"
                                   maxlength="50" fieldname="screenReportid">
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="元器件分类">
                            元器件分类<span style="color: red;">*</span>
                        </label>
                        <div class="layui-input-block qbdms-input" >
                            <@dicSelect.dic name="componentType" nodeKey="yqjfl" verify="required" reqtext="元器件分类是必填项"/>
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="筛选技术条件">
                            筛选技术条件<span style="color: red;">*</span>
                        </label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="screenTechconditions"  placeholder="请输入"
                                   autocomplete="off" class="layui-input  textInput" lay-verify="required" lay-reqtext="筛选技术条件是必填项"
                                   maxlength="50" fieldname="screenTechconditions">
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="筛选单位">
                            筛选单位<span style="color: red;">*</span>
                        </label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="screenUnits"  placeholder="请输入"
                                   autocomplete="off" class="layui-input  textInput" lay-verify="required" lay-reqtext="筛选单位是必填项"
                                   maxlength="50" fieldname="screenUnits">
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="筛选类别">
                            筛选类别<span style="color: red;">*</span>
                        </label>
                        <div class="layui-input-block qbdms-input">
                            <@dicSelect.dic name="screenCategory" nodeKey="sxlb" verify="required" reqtext="筛选类别是必填项"/>
                        </div>
                    </div>

                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="送筛单位">
                            送筛单位<span style="color: red;">*</span>
                        </label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="screenedUnits"  placeholder="请输入"
                                   autocomplete="off" class="layui-input  textInput" lay-verify="required" lay-reqtext="送筛单位是必填项"
                                   maxlength="50" fieldname="screenedUnits">
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="送筛日期">
                            送筛日期<span style="color: red;">*</span>
                        </label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="screenDate"  placeholder="请输入" readonly
                                   autocomplete="off" class="layui-input  textInput dateTimeFiled time-init" lay-verify="required" lay-reqtext="送筛日期是必填项"
                                   maxlength="50" fieldname="screenDate">
                        </div>
                    </div>
                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label"  title="进口/国产">
                            进口/国产
                        </label>
                        <div class="layui-input-block qbdms-input" >
                            <@dicSelect.dic name="source" nodeKey="jk/gc" />
                        </div>
                    </div>

                    <div class="qbdms-textarea  ">
                        <label class="layui-form-label qbdms-label" title="不合格原因">不合格原因<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <textarea  name="unqualifiedReason" rows="2" class="layui-textarea" placeholder="请输入"
                                   lay-verify="required" lay-reqtext="不合格原因是必填项" maxlength="1000" ></textarea>
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-hide">
                <input type="text" name="id" placeholder="请输入"
                       autocomplete="off" class="layui-input " maxlength="50" fieldname="id">
            </div>

            <div class="layui-form-item btnformItem">
                <p>
                    <span id="hideAndShow" style="display: none;">
                        <a lay-submit lay-filter="wQbdComponentscreen" class="layui-btn btn-n privateSubmit qbdms-oneBtn"
                           requrl="${ctx}/qbdms/wQbdComponentscreen/save">提交</a>
                    </span>
                    <button type="reset" id="closeWindow" style="margin-left: 10px;"
                            class="layui-btn layui-btn-sm btn-save qbdms-oneBtnLine">取消
                    </button>
                </p>
            </div>
        </form>
    </div>
</div>
<script src="${ctx}/qbdmsStatic/public/configFile.js"></script>
<script src="${ctx}/layui/layui.js"></script>

<script>
    layui.config({
        base: serverPath.qbdmsPath + staticPath.qbdmsPath //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','common','laydate','jquery','publicMethods','propsHandle','qbdmsForm'], function () {
        var laydate = layui.laydate;
        var $ = layui.jquery;
        var common = layui.common;
        var form = layui.qbdmsForm;
        var publicMethods = layui.publicMethods;
        var propsHandle = layui.propsHandle;
        var dateTimeFiledLen = $(".dateTimeFiled");

        var today=new Date();
        for(var i=0;i<dateTimeFiledLen.length;i++){
            laydate.render({
                elem: dateTimeFiledLen[i] //指定元素
                ,type: 'date'
                ,trigger: 'click'
                ,max: today.toString()
            });
        }

        form.verify({
            bigger:function (value) {
                if (parseInt(value)>parseInt($("input[name='screenNumber']").val())) {
                    return '不合格数不可大于筛选数量';
                }},
            num: function (value,item) {
                if (value && ! new RegExp(/^[+]{0,1}(\d+)$/).test(value)) {
                    return common.verifyTitleAdd(item)+'只能输入非负整数';
                }}
        });
        var  defProps = {
                //viewMould: 'form/formDef/view/formDesign/moulds/', // 组件模块 存放文件 *****
                viewMould: 'moulds/', // 组件模块 存放文件 *****
                formAreaInfo: '.formPreview',
                formAreaInfo: 'html',
                temDate: '.temDate',
                uploadFileBtn: '.uploadFileBtn',
                uploadImgBtn: '.uploadImgBtn',
                richTextArea: '.richTextArea',
                selectInput: '.selectInput',
                radioOptionCont: '.radioOptionCont',
                dataLexiTree: '.dataLexiTree',
                selectorBtn: '.selectorBtn'
            },
            temQuery = new propsHandle();  // 实例化模板功能部分

        // 初始化模板功能
        temQuery.initTem({
            selectorBtn: defProps.selectorBtn,
            selectorTemPath: setter.views + defProps.viewMould
        });
        //关闭当前页面
        $("#closeWindow,.closeWindow").click(function () {
            window.location.href = serverPath.qbdmsPath + '/qbdms/wQbdComponentscreen/view/list';
        });


        var runId = "${runId}";
        if(runId == null || runId == ''){
            $("#hideAndShow").show();
        }

        var index = parent.layer.getFrameIndex(window.name);
        common.updateForm({
            name:'wQbdComponentscreenDataForm',
            idValue:"${id}",
            primary:"id",
            getCallback: function (data) {},
            updateCallback:function (data) {
                if (common.filterRecord(data)) {
                    if($(".privateSubmit")){
                        $(".privateSubmit").attr("disabled",false).css("pointer-events","auto");
                    }
                    layer.alert(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'}, function (index) {
                        layer.close(index);
                        window.location.href = serverPath.qbdmsPath + '/qbdms/wQbdComponentscreen/view/list';
                    });
                } else {
                    layer.alert(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'});
                }
                return false;
            }
        });

        // 供应商
        var suppliers = eval('${wQbdSuppliers}');
        var initXHDH = function (optionObj, item) {
            optionObj.text = item.suppliername;
            optionObj.value = item.suppliercode;
        };
        common.initDicData("supplier", suppliers, "", initXHDH);

        publicMethods.bottomFixd()
        form.on('select', function(data){
            publicMethods.bottomFixd()
        });
    });
</script>
</body>
</html>